#ifndef CUSTOMIZEEDIT_H
#define CUSTOMIZEEDIT_H

#include <QLineEdit>

// 特制编辑框类
class CustomizeEdit : public QLineEdit
{
    Q_OBJECT
public:
    CustomizeEdit(QWidget* parent = nullptr);

    void SetMaxLength(int max_len);

protected:
    void focusOutEvent(QFocusEvent *event) override;

private:
    void limitTextLength(QString text);

signals:
    // 失去焦点的信号
    void sig_foucus_out();

private:
    int m_max_len;
};

#endif // CUSTOMIZEEDIT_H
